package com.nervenets.web.hibernate.domain;

import com.nervenets.utils.StringUtils;
import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * 开户资料
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AccountOpen extends DomainObject {
    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;
    private String card2;//工行联名II类卡号
    private String trueName;//真实姓名
    private String idFrontImage;//身份证正面
    private String idBackImage;//身份证反面
    private String idCard;//身份证号码
    private String idCardInvalidDate;//身份证失效日期
    private String idCardSignDate;//身份证签发日期
    private String accountOrgNo;  //网点号

    public boolean isSuccess() {
        return !StringUtils.isEmpty(card2);
    }
}
